;=============================================================================== ; Sample Script for Pinnacle Software's TextHarvest Product ;=============================================================================== ; ; This script was designed for the ToDoListDelim.dat sample input file, ; which is included with Pinnacle Software's script-enabled product ; TextHarvest (free download at www.parse-o-matic.com). The file terminates ; (i.e. delimits) each record with hex $00. ; ; This script converts the file (which apart from its data format is ; identical to the sample file ThingsToDo.txt) to CSV (Comma Separated ; Value) format. The CSV file will contain the two fields from the input ; file, along with a record counter. ; ;=============================================================================== ; Config section ;============================================================================== Config ;----------------------------------------------------------------------------- ; Files ;----------------------------------------------------------------------------- $CfgDefaultIFN = 'ToDoListDelim.dat' $CfgDefaultOFN = 'Temp.csv' $CfgInpFileType = 'Delimited' $CfgDelimiter = $00 $CfgOutFileType = 'Text' ;----------------------------------------------------------------------------- ; Documentation ;----------------------------------------------------------------------------- $CfgCopyright = 'Copyright © 2005 by Pinnacle Software' $CfgVersion = '1.00.00' $CfgProgrammer = 'Timothy Campbell' $CfgEmail = 'info@parse-o-matic.com' $CfgLicense = 'This script may be used, at no charge, with any ' >> 'script-enabled Parse-O-Matic application, subject to any additional ' >> 'licensing requirements of such application.' End ;=============================================================================== ; Check settings ;=============================================================================== TaskInit Begin $ActualIFN ~ $CfgDefaultIFN Stop 'Please try this script with the' $0A$0D >> 'input file' $CfgDefaultIFN End RecNum = 0 End ;=============================================================================== ; Get the category, remove extra spaces, and change case ;=============================================================================== Category = $OutData[1 9] ; Get columns 1 to 9 TrimChar Category ; Remove spaces on either side Category = ChangeCase Category 'Hardcaps' ; Capitalize The Text ;=============================================================================== ; Get the description and remove the trailing spaces. ;=============================================================================== Description = $OutData[10 80] TrimChar Description 'R ' ;=============================================================================== ; Send CSV data to the output file ;=============================================================================== Inc RecNum PadRecNum = Padded RecNum 3 'Left' '0' OutCSV '' 'Init' OutCSV PadRecNum 'Unquoted' OutCSV Category OutCSV Description OutCSV '' 'Done'